import requests

#
# url = "https://www.yuanxiapi.cn/api/theweather/"
# headers = {""}
# data = {
#     "city":"北京"
# }
# r = requests.get(url=url,headers=headers,params=data)
#
# print(r.json())


# url = "https://www.yuanxiapi.cn/api/theweather/"
# data = {
#     "city":"北京"
# }
# r = requests.get(url=url,params=data)
#
# print(r.json())


#
url = 'http://47.100.175.62:3000/api/v1/topics'
bodydata = {
    "accesstoken":"c175d304-8e09-4095-80ef-87765dc228ad",
    "title":"helloworld",
    "tab":"ask",
    "content":"xxxxxxxx"
}

# 发送post请求
r = requests.post(url=url,data=bodydata)
print(r.status_code)
print(r.json())
# 请求header
print(r.request.headers)